home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / TASEXAM6.ARJ / BASE-NH.TAS < prev    next >
Text File  |  1992-03-08  |  5KB  |  146 lines

  1. {
  2. This script is geared toward investors who like to buy stocks at or near
  3. new highs, as they emerge from basing patterns. It finds and graphs all
  4. stocks which are making new highs, and all stocks which are within 5%
  5. of their high AND have been in a narrow trading range for a period of time.
  6. "Narrow" is <15% for at least 30 days, <20% for at least 40 days, or <25%
  7. for at least 60 days. Stocks which meet none of the above conditions will
  8. be passed.
  9. The script then counts how many days the stock has been trading in ranges
  10. <15%, <20%, and <25%. It reports these values on the graph. The graph
  11. also draws lines defining any base <15% for greater than 30 days, or any
  12. <20% base for greater than 40 days, or any base <25% for greater than
  13. 60 days. Stocks making new highs will not always have base lines drawn
  14. on the graph, as there may be none which meet one of the conditions above.
  15. Bases of <15% will be defined with red lines, <20% with green lines, and
  16. <25% with blue lines.
  17. The volume graph tells volume today, 50MA of volume, % today vs average,
  18. prior 5MA % of 50MA, and prior 10MA % of 50MA. The prior 5MA and 10MA
  19. do not include today, rather they end yesterday. They are intended to
  20. show how volume behaved immediately prior to today's action.
  21. Most data is displayed on the screen during processing, and it is saved
  22. in the output file "BASE-NH.LST".
  23. Written 3/6/92 by Tom Rategan.  Prodigy PMGV10A
  24. }
  25. #max_quotes 255
  26. #output_file 'BASE-NH.LST'
  27. if first_ticker then begin
  28. writeln(
  29. '      ********* New highs and possible near base breakouts. *********
  30. ');
  31. writeln(
  32. '                                          Days in Range');
  33. writeln(
  34. '    Name           Close    Change   %OH  <15% <20% <25%    Vol     %Vol  '
  35. );
  36. writeln(
  37. '    ----           -----    ------   ---  ---- ---- ----    ---     ---- '
  38. );
  39. end;
  40. if quote_count < 65 then return;
  41. hiqc : array;
  42. qc = (quote_count-2);
  43. hiqc = hhv(c,qc);
  44. if c = hiqc then goto loop15;
  45. if c < (hiqc*.95) then return;
  46. hi30 : array;
  47. lo30 : array;
  48. hi30 = hhv(c,30);
  49. lo30 = llv(c,30);
  50. hi40 : array;
  51. lo40 : array;
  52. hi40 = hhv(c,40);
  53. lo40 = llv(c,40);
  54. hi60 : array;
  55. lo60 : array;
  56. hi60 = hhv(c,60);
  57. lo60 = llv(c,60);
  58. r30 = (1-(lo30/hi30))*100;
  59. r40 = (1-(lo40/hi40))*100;
  60. r60 = (1-(lo60/hi60))*100;
  61. if r30 <= 15 or r40 <= 20 or r60 <= 25 then goto loop15;
  62. return;
  63. :loop15
  64. t15 = 1;
  65. :loop15a;
  66. gosub howlong15;
  67. if t15 = (qc*(-1)) then goto loop20;
  68. if ((1-(c[t15]/hiqc))*100) > 15 then goto loop20 else goto loop15a;
  69. :howlong15
  70. t15 = t15-1;
  71. return;
  72. :loop20
  73. t15=(t15+1)*(-1);
  74. t20 = -(t15);
  75. :loop20a
  76. gosub howlong20;
  77. if t20 = (qc*(-1)) then goto loop25;
  78. if ((1-(c[t20]/hiqc))*100) > 20 then goto loop25 else goto loop20a;
  79. :howlong20
  80. t20 = t20-1;
  81. return;
  82. :loop25
  83. t20 =(t20+1)*(-1);
  84. t25 = -(t20);
  85. :loop25a
  86. gosub howlong25;
  87. if t25 = (qc*(-1)) then goto graphit;
  88. if ((1-(c[t25]/hiqc))*100) > 25 then goto graphit else goto loop25a;
  89. :howlong25
  90. t25 = t25-1;
  91. return;
  92. :graphit
  93. t25 = (t25+1)*(-1);
  94. hi15 : array;
  95. lo15 : array;
  96. hi15 = hhv(c,t15);
  97. lo15 = llv(c,t15);
  98. hi20 : array;
  99. lo20 : array;
  100. hi20 = hhv(c,t20);
  101. lo20 = llv(c,t20);
  102. hi25 : array;
  103. lo25 : array;
  104. hi25 = hhv(c,t25);
  105. lo25 = llv(c,t25);
  106. v50 : array;
  107. v50 = mov(v,50,'s');
  108. vv50 = ((v[0]/v50[0])*100);
  109. v5 = (v[-1]+v[-2]+v[-3]+v[-4]+v[-5])/5
  110. v5v50 = ((v5/v50[0])*100);
  111. v10 = (v[-1]+v[-2]+v[-3]+v[-4]+v[-5]+v[-6]+v[-7]+v[-8]+v[-9]+v[-10])/10
  112. v10v50 = ((v10/v50[0])*100);
  113. oh = 100-((c/hiqc)*100);
  114. chg = (c[0]-c[-1])
  115. opengraph(2);
  116. sizegraph(2,1);
  117. graph(1,' '+format(c[0],'$%5.2f')+' is '+format(oh,'%2.2f%')+
  118. ' off '+format(hiqc[0],'$%5.2f')+' high. Change= '+format(chg,'$%2.2f')
  119. +'  15%Rg='+format(t15,'%2.f')
  120. +' days.  20%Rg='+format(t20,'%2.f')+' days.  25%Rg='
  121. +format(t25,'%2.f')+' days.');
  122. if t15 >= 30 then goto draw15;
  123. if t20 >= 40 then goto draw20;
  124. if t25 >= 60 then goto draw25;
  125. goto volgraph;
  126. :draw25
  127. drawline(9,0,lo25[-1],0,lo25[-1],-t25,-1);
  128. drawline(9,0,hi25[-1],0,hi25[-1],-t25,-1);
  129. goto volgraph;
  130. :draw20
  131. drawline(2,0,lo20[-1],0,lo20[-1],-t20,-1);
  132. drawline(2,0,hi20[-1],0,hi20[-1],-t20,-1);
  133. goto volgraph;
  134. :draw15
  135. drawline(12,0,lo15[-1],0,lo15[-1],-t15,-1);
  136. drawline(12,0,hi15[-1],0,hi15[-1],-t15,-1);
  137. goto volgraph;
  138. :volgraph
  139. graph(v,'Today='+format(v[0],'%5.f')+'   50MA='+format(v50[0],'%5.f')
  140. +'   %Today='+format(vv50,'%4.f%')+'    5MA='+format(v5v50,'%4.f%')
  141. +' of 50MA.  10MA='+format(v10v50,'%4.f%')+' of',v50,'50MA');
  142. closegraph();
  143. writeln(fullname,' ',c[0],' ',chg,int(oh),'%',int(t15),int(t20),int(t25)
  144. ,'  ',v[0],' ',int(vv50),'%');
  145. return;
  146.